import slide from '../components/slide.vue';
export default {
    name:'mx-slide',
    components:{
        [slide.name]:slide,
    },
    mounted(){
        this.$on('slide-refresh',()=>{
            this.pullLoad(false,true);
            this.$emit('slide-gotop')
        })

        this.$on('slide-gotop',()=>{
            document.documentElement.scrollTop = document.body.scrollTop = 0;
            this.$refs.slide.$emit('toggleTop',false)
        });

        this.$on('slide-comment',()=>{
            location.href = this.$config.pages.comment + '?type=news&id=' + this.info.id;
        })

        this.$on('SCROLL',(e,params)=>{
            if(params.top>=500){
                this.$refs.slide.$emit('toggleTop',!params.flag)
            }else{
                this.$refs.slide.$emit('toggleTop',false)
            }
        })
    },
    methods:{
    }
}